        function $(id) {
            return document.getElementById(id)
        }

        function check() {
            var user = $("user").value
            var pwd1 = $("pwd1").value
            // var pwd2 = $("pwd2").value

            if (user == "" || pwd1 == "") {
                alert("输入的用户名或密码不能为空!")
                return false
            }

            if (pwd1.length < 6) {
                alert("密码必须大于六位！")
                return false
            }

            // if (pwd1 != pwd2) {
            //     alert("两次密码不一致！")
            //     return false
            // }

            if (user == "毛建刚" || pwd1 == "123456789") {
                alert("登录成功！");
                window.location = ("index.html")
                // return false
            } else {
                alert("登录失败！")
                return false
            }
        }

        $(function () {

        })

        function openDialog() {
            document.getElementById('light').style.display = 'block';
            document.getElementById('fade').style.display = 'block'
        }

        function closeDialog() {
            document.getElementById('light').style.display = 'none';
            document.getElementById('fade').style.display = 'none'
        }

        // 全屏
        function fullscreen() {
            var docElm = document.documentElement;
            if (docElm.requestFullscreen) {
                docElm.requestFullscreen();
            } else if (docElm.mozRequestFullScreen) {
                docElm.mozRequestFullScreen();
            } else if (docElm.webkitRequestFullScreen) {
                docElm.webkitRequestFullScreen();
            } else if (docElm.msRequestFullscreen) {
                docElm.msRequestFullscreen();
            }
        }

        // 退出全屏
        function exitFullscreen() {
            if (document.exitFullscreen) {
                document.exitFullscreen();
            } else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            } else if (document.webkitCancelFullScreen) {
                document.webkitCancelFullScreen();
            } else if (document.msExitFullscreen) {
                document.msExitFullscreen();
            }
        }

        // 监听是否全屏
        window.onload = function () {
            var elem = document.getElementById('state');
            document.addEventListener('fullscreenchange',
                function () {
                    elem.innerText = document.fullscreen ? 'yes' : 'no';
                },
                false);
            document.addEventListener('mozfullscreenchange',
                function () {
                    elem.innerText = document.mozFullScreen ? 'yes' : 'no';
                },
                false);
            document.addEventListener('webkitfullscreenchange',
                function () {
                    elem.innerText = document.webkitIsFullScreen ? 'yes' : 'no';
                },
                false);
            document.addEventListener('msfullscreenchange',
                function () {
                    elem.innerText = document.msFullscreenElement ? 'yes' : 'no';
                },
                false);
        }